<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>测试js数组包含</title>
</head>
<body>
<script type="text/javascript">
    var k=[1,2,3]
    alert(k.indexOf(1)>-1);
</script>
</body>
</html>